<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="renderer" content="webkit" />
        <title>在线会商服务系统</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="../bootstrap3/jquery-1.9.1.min.js"></script>
    </head>
    <body>
        <header class="header" style="text-align: center">
            <span class="pull-right"><small>欢迎访问</small><b>在线会商服务系统</b></span>
        </header>
        <div style="text-align: center">
            <table>
                <tr>
                    <td></td>
                    <td></td>
                </tr>
            </table>

            <form id="form-change-info" class="form-horizontal" role="form">
                <div class="form-group">
                    <div>
                        用户：<input id="userName" type="text">
                    </div>
                    <div>
                        角色：<input id="roleName" type="text">
                    </div>
                    <div>
                        权限：<input id="powerName" type="text">
                    </div>
                </div>
            </form>

        </div>

    <script>
        $(document).ready(function() {
            $.ajax({
                url: "/users/get_by_uid",
                type: "GET",
                dataType: "json",
                success: function(json) {
                    if (json.state == 200) {
                        console.log("userName=" + json.data.userName);

                        $("#userName").val(json.data.userName);
                    } else {
                        alert("获取用户信息失败！" + json.message);
                    }
                }
            });
        });

        $(document).ready(function() {
            $.ajax({
                url: "/role",
                type: "GET",
                dataType: "JSON",
                success: function(json) {
                    if (json.state == 200) {
                        console.log("roleName=" + json.data.role);

                        $("#roleName").val(json.data.role);
                    } else {
                        alert("获取角色信息失败！" + json.message);
                    }
                }
            });
        });
    </script>
    </body>
</html>